package com.xiaofeng.pochi.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaofeng.pochi.common.Page;
import com.xiaofeng.pochi.pojo.ShopBrand;
import com.xiaofeng.pochi.pojo.ShopProduct;
import com.xiaofeng.pochi.pojo.ShopProductEs;
import com.xiaofeng.pochi.pojo.dto.ShopProductDto;
import com.xiaofeng.pochi.pojo.dto.ShopProductSearchDto;
import com.xiaofeng.pochi.pojo.vo.ShopProductVo;

import java.util.List;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: chc
 * @Date: 2022/08/10/23:28
 * @Description:
 */
public interface ShopProductService extends IService<ShopProduct> {

    void save(ShopProductDto shopProductDto);

    //获取分页
    Page<ShopProductVo> getByPage(Page<ShopProductVo> page);

    /**
     * 查询回显
     *
     * @param id
     * @return
     */
    ShopProductVo getUpdate(Long id);

    /**
     * 修改
     * @param shopProductDto
     */
    void update(ShopProductDto shopProductDto);

    /**
     * 删除
     * @param id
     */
    void delete(Long id);

    /**
     * 上架
     * @param id
     */
    void publish(Long id);

    /**
     * 下架
     * @param id
     */
    void unPublish(Long id);

    /**
     * 新品
     * @param id
     */
    void news(Long id);

    /**
     * 取消新品
     * @param id
     */
    void old(Long id);

    /**
     * 推荐
     * @param id
     */
    void recommend(Long id);

    /**
     * 取消推荐
     * @param id
     */
    void unRecommend(Long id);

    List<ShopProduct> getProductDetailList(Long packCode);

    Page<ShopProductVo> getByPageHasNotPack(Page<ShopProductVo> page);

    /**
     * 查询新品商品
     * @return
     */
    List<ShopProduct> getNewProduct();

    /**
     * 查询推荐商品
     * @return
     */
    List<ShopProduct> getRecommendList();
    /**
     * 根据ID查询
     * @param id
     * @return
     */
    ShopProductVo get(Long id);


    /**
     * 根据商品编号查询所在类目下销量最高的6条数据
     * @param productId
     * @return
     */
    List<ShopProduct> getRankByProduct(Long productId);

    /**
     * 搜索
     * @param shopProductDto
     * @return
     */
    Page<ShopProductEs> search(ShopProductSearchDto shopProductDto);

    /**
     * 根据id查询
     * */
    List<ShopProduct> getByIds(List<Long> ids);
}
